﻿using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;

public class Roska : Enemies
{
    /// <summary>
    /// Constructor.
    /// </summary>
    /// <param name="speed">Speed of movement</param>
    /// <param name="friction">Friction applyed on movement</param>
    /// <param name="position">Initial position</param>
    public Roska(float speed, float friction, Vector2 position)
        : base(speed, friction, position)
    {
        LoadContent(GameSession.Content);
        Life = 3;
    }

    /// <summary>
    /// Loads the character sprite sheet and sounds.
    /// </summary>
    public override void LoadContent(ContentManager content)
    {
        // Load animated textures.
        idleAnimation = new Animation(content.Load<Texture2D>("Textures/Characters/Art Inimigos Final/Roska/Roska Parado"), 0.1f, true);
        walkingAnimation = new Animation(content.Load<Texture2D>("Textures/Characters/Art Inimigos Final/Roska/Roska Andando"), 0.1f, true);
        hitAnimation = new Animation(content.Load<Texture2D>("Textures/Characters/Art Inimigos Final/Roska/Roska Atingido"), 0.1f, false);
        dyingAnimation = new Animation(content.Load<Texture2D>("Textures/Characters/Art Inimigos Final/Roska/Roska Morrendo"), 0.1f, false);

        testCollider = content.Load<Texture2D>("Textures/Characters/testCollider");

        tankingDamageSound = @"Audio/Sons Combate/Barril Acertando";
        
        // Calculate bounds within texture size.            
        int width = (int)(idleAnimation.FrameWidth * Globals.CollisionWidth);
        int left = (idleAnimation.FrameWidth - width) >> 1;
        int height = (int)(idleAnimation.FrameWidth * Globals.CollisionHeight) >> 1;
        int top = (idleAnimation.FrameHeight - height);
        localBounds = new Rectangle(left, top, width, height);

        //Avoiding crashes on differents CPU's.
        sprite.PlayAnimation(idleAnimation);
    }
}
